package com.jt.www.admin.order_pc.service;

import com.jt.www.domain.bo.OfflineEndorseBO;
import com.jt.www.domain.po.OfflineEndorse;
import com.jt.www.domain.qo.OfflineEndorseQO;
import com.jt.www.domain.vo.OfflineEndorsePolicyVo;
import com.jt.www.model.reps.GenericDataResponse;
import com.jt.www.model.reps.GenericListResponse;
import org.springframework.http.ResponseEntity;

import java.util.Date;

/**
 * 线下批单
 * Created by shaoyn on 2020/05/22.
 */
public interface OfflineEndorseService {

    /**
     * 保存线下批单
     *
     * @param offlineEndorse
     * @return
     */
    int saveOfflineEndorse(OfflineEndorse offlineEndorse);

    /**
     * 通过批单号 查看是否存在
     * 1.线下批单有(且审核状态为已审核)
     * 2.批单中心有
     *
     * @param endorseNo
     * @return
     */
    boolean isExistent(String findCode, String endorseNo);

    /**
     * 查询批单出单日期是否跨期
     * @param findCode
     * @param endorseNo
     * @param endorseIssueDate
     * @return
     * @throws Exception
     */
    boolean isIntertemporal(String findCode,String endorseNo, Date endorseIssueDate) throws Exception;
    /**
     * 查询线下批单列表
     *
     * @param offlineEndorseQO
     * @return
     */
    ResponseEntity<GenericListResponse<OfflineEndorse>> queryOfflineEndorse(OfflineEndorseQO offlineEndorseQO);

    /**
     * 查询批单录入详情
     *
     * @param EndorseId
     * @return
     */
    ResponseEntity<GenericDataResponse<OfflineEndorseBO>> queryOfflineEndorseDetails(Long EndorseId);

    /**
     * 修改批单录入
     *
     * @param offlineEndorse
     * @return
     */
    int updateOfflineEndorse(OfflineEndorse offlineEndorse) throws Exception;

    /**
     * 审核状态
     *
     * @param offlineEndorse
     * @return
     */
    ResponseEntity auditOfflineEndorse(String findCode, OfflineEndorse offlineEndorse);

    /**
     * @param policyNo
     * @return
     */
    OfflineEndorsePolicyVo queryPolicyByPolicyNo(String policyNo);

    /**
     * 删除批单
     *
     * @param id
     * @return
     */
    ResponseEntity deleteEndorse(Long id);


    /**
     * 推送
     *
     * @param id
     * @throws Exception
     */
    void pushEndorseToPol(String findCode, Long id) throws Exception;
}
